package com.example.jf.jfapp;

import android.app.AlertDialog;
import android.content.DialogInterface;
import android.os.Bundle;
import android.view.KeyEvent;

import com.example.jf.jfapp.activity.base.BaseActivity;

public class StatusDetailsActivity extends BaseActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_status_details);
        dialog();

    }
    //在里面创建一个对话框
    protected  void  dialog(){
        AlertDialog.Builder builder=new AlertDialog.Builder(StatusDetailsActivity.this);
        builder.setMessage("该应用没写好？");
        builder.setTitle("提示");
        builder.setPositiveButton("确认", new DialogInterface.OnClickListener() {
            @Override
            public void onClick(DialogInterface dialog, int i) {
                dialog.dismiss();
                finish();
            }
        });
        builder.create().show();

    }
    public boolean onKeyDown(int keyCode, KeyEvent event) {
if (keyCode == KeyEvent.KEYCODE_BACK && event.getRepeatCount() == 0) {
dialog();
}
return false;
}
}
